import { useModel } from "umi";
import { useReactive } from "ahooks";

const useDeleteVersion = () => {
    const { remoteData } = useModel("global");

    const state = useReactive({
        loading: false,
    });

    const deleteApplicationVersion = async (params, callback) => {
        state.loading = true;
        let res = await remoteData({
            object: "bnt-application-resource-center-service",
            serviceName: "/developer/person/application/deleteVersion",
            params,
        });
        res && callback && callback(res);
        state.loading = false;
    };

    return { ...state, deleteApplicationVersion };
};

export default useDeleteVersion;
